package com.yict.csms.system.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.yict.common.entity.PageEntity;
import com.yict.common.service.ICommonService;
import com.yict.csms.system.entity.Dataper;
import com.yict.csms.system.entity.User;
import com.yict.csms.system.entity.UserGroup;
import com.yict.csms.system.entity.UserUserGroup;

/**
 * 
 * 
 * @author Patrick.Deng
 * 
 */
public interface IUserService extends ICommonService<User, Long> {

	public List<User> search(Map<String, Object> queryMap, PageEntity page);

	public boolean save(User user, HashMap<Long, String> userGroupFlag, HashMap<Long, String> userDataperIdFlag);
	
	public boolean update(User user, HashMap<Long, String> userGroupFlag, HashMap<Long, String> userDataperIdFlag);

	public List<UserUserGroup> findGroupByUserId(String ids);
	
	public User getUserByName(String userName,String passWord) throws Exception;
	
	public User findUserById(Long id);
	
	/**
	 * 查询当前指定用户的所属数据权限小组
	 * @param userId
	 * @return
	 */
	public List<Dataper> getUserDataper(Long userId);

	/**
	 * 查询当前指定用户的所属权限小组
	 * @param userId
	 * @param type
	 * @return
	 */
	List<UserGroup> getUserGroups(Long userId,String type);
	
	/**
	 * 根据id查找实体
	 * @param ids
	 * @return
	 */
	public List<User> listByIds(Collection<Long> ids);
}
